<?php
/**
 * multipleTradeMergeQuery	批量交易查询	接口
 * Date: 2016/11/24 14:34
 */

function testResponse(){

    $config = $GLOBALS['config'];
    $user = $GLOBALS['user'];

    $objReq = new \yijipay\message\request\MultipleTradeMergeQueryRequest();

    //请求公共部分
    $objReq->setReturnUrl(getReturnUrl());
    $objReq->setNotifyUrl(getNotifyUrl());
    //partnerId默认yijipay\config.php中已经配置
    //$objReq->setPartnerId($config['partnerId']); 
    $objReq->setMerchOrderNo("T" . genOrderNo());
    $objReq->setOrderNo("RID".genOrderNo());
    //signType默认MD5
    $objReq->setSignType("RSA");
    //$objReq->setContext("");


    //选填参数
    $objReq->setTradeNos("000s00401g82n3wajg00,000s00401g9n1opjjs00");
//    $objReq->setMerchantOrderNos("PERSONAL");


    //构建请求
    $client = new \yijipay\YijiPayClient($config);
    

    echo "================request: preSignStr：";
    echo "<br/>". \yijipay\SignHelper::getPreSignStr($objReq);

    $response = $client->execute($objReq);
    $resp = json_decode($response);
    if($client->verify($response) && $resp->success){
        //================================
        // 此处填写创建成功的代码
        //================================

    }else{
        //================================
        // 此处填写创建成功的代码
        //================================
        throw new Exception($resp->resultMessage);
    }

    exit;

}